public class TestDate {
    public int year=1999;//年
    public int month=12;//月
    public int day=10;//日
    public void printDate() {
        System.out.println(this.year+"-"+this.month+"-"+this.day);
    }
    public static void main(String[] args) {
        TestDate testDate = new TestDate();

        //给year,month,day赋值的一种方式
        testDate.year = 2022;
        testDate.month = 8;
        testDate.day = 4;
        testDate.printDate();

    }
}
